package org.example.mapper;

import org.apache.ibatis.annotations.Mapper;
import org.apache.ibatis.annotations.Param;
import org.example.entity.CourseCollect;

import java.util.List;

/**
 * @ClassName courseCollectMapper
 * @Description TODO
 * @Author qiuye
 * @Date 2025年08月15日 16:58
 * @Version 1.0
 */
@Mapper
public interface CourseCollectMapper {
//    课程收藏
    List<CourseCollect> getByCourse(int id);

//
    int add(@Param("userId") int userId,@Param("courseId")  int courseId);

    Integer countByUserAndCourse(@Param("userId") int userId, @Param("courseId") int courseId);

    int deleteByUserAndCourse(@Param("userId") int userId, @Param("courseId") int courseId);
    // 新增：查询用户是否收藏某课程
    Integer countByUserAndCourse1(@Param("userId") int userId, @Param("courseId") int courseId);
}
